wayland: Only process the event if it's for a GdkWindow
authorRob Bradford <rob@linux.intel.com>
Sun, 4 Aug 2013 12:32:41 +0000 (13:32 +0100)
committerRob Bradford <rob@linux.intel.com>
Sun, 4 Aug 2013 13:42:14 +0000 (14:42 +0100)
When we combine GTK with Clutter we will receive events for both surfaces that
we have created as well as those created by Clutter.

gdk/wayland/gdkdevice-wayland.c

index 225c12eac55f1160eba6f1b41acb44cd7a88e593..7624fa1b46e88d959ff7033dd5c3ec366ac8683a 100644 (file)
@@ -598,6 +598,8 @@ pointer_handle_enter (void              *data,
 
   if (!surface)
     return;
+  if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+    return;
 
   _gdk_wayland_display_update_serial (wayland_display, serial);
 
@@ -641,6 +643,8 @@ pointer_handle_leave (void              *data,
 
   if (!surface)
     return;
+  if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+    return;
 
   _gdk_wayland_display_update_serial (wayland_display, serial);
 
@@ -844,6 +848,8 @@ keyboard_handle_enter (void               *data,
 
   if (!surface)
     return;
+  if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+    return;
 
   _gdk_wayland_display_update_serial (wayland_display, serial);
 
@@ -878,6 +884,8 @@ keyboard_handle_leave (void               *data,
 
   if (!surface)
     return;
+  if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
+    return;
 
   _gdk_wayland_display_update_serial (wayland_display, serial);